<%@page import="java.text.SimpleDateFormat"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
    String contextPath = request.getContextPath();
%>   
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page import="java.util.*,java.awt.*"%>    
<%@ page import="java.sql.*,service.IUserService,service.UserService,model.User"%> 
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Basic ValidateBox - jQuery EasyUI Demo</title>
<link rel="stylesheet" type="text/css" href="jslib/easyui1.4.3/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="jslib/easyui1.4.3/themes/icon.css">
<link rel="stylesheet" type="text/css" href="jslib/easyui1.4.3/demo.css">
<script type="text/javascript" src="jslib/easyui1.4.3/jquery.min.js"></script>
<script type="text/javascript" src="jslib/easyui1.4.3/jquery.easyui.min.js"></script>
<script type="text/javascript" src="jslib/easyui1.4.3/locale/easyui-lang-zh_CN.js" charset="utf-8"></script>
<script type="text/javascript">
    $(function () {
    	$.extend($.fn.validatebox.defaults.rules, {  
    	     /*必须和某个字段相等，判断两次密码是否相同*/
    	     equalTo: {
    	         validator:function(value,param){
    	             return $(param[0]).val() == value;
    	         },
    	         message:'字段不匹配'
    	     }
    	 });	
});
</script>
</head>
<body>
<%//输出当前日期
Calendar cal = Calendar.getInstance();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); 
String regdatetime=formatter.format(cal.getTime()); 
%>
<h3>Basic ValidateBox</h3>
<p>It's easy to add validate logic to a input box.</p>

<div style="margin:20px 0;"></div>
<div class="easyui-panel" title="Register" style="width:400px;padding:10px 60px 20px 60px">
<form action = "RegisterServlet" method="POST"> 		
<table cellpadding="5">
<tr>
<td>用户名:</td>
<td><input class="easyui-validatebox textbox" name="username" value="" data-options="required:true,validType:'length[3,10]'"></td>
</tr>
<tr>
<td>性别：</td>
<td><input type="radio" name="gender" value="男" checked>男&nbsp;&nbsp;&nbsp;
<input type="radio" name="gender" value="女">女&nbsp;&nbsp;&nbsp;</td>

<tr>   
<td>年龄：</td>   
<td><input id="ss" class="easyui-numberspinner" name="age" value="" style="width:80px;"
required="required" data-options="min:12,max:150,editable:false">
</td>   
</tr>

           <tr><td>电子邮箱:</td>
			<td><input class="easyui-validatebox textbox" name="email" value="" data-options="required:true,validType:'email'"></td>
			</tr>
<tr><td>密码：</td> 
<td><input type="password" name="password" id="password" data-options="required:true" class="easyui-validatebox textbox" validType="length[4,32]" value=""/></td>
</tr>
<tr><td>确认密码：</td>
<td><input type="password" name="repassword" id="repassword" data-options="required:true" class="easyui-validatebox textbox"  validType="equalTo['#password']" invalidMessage="两次输入密码不匹配"/></td>
</tr>
			<tr>
			<td>注册时间:</td>
			<td><%=regdatetime %></td>
		</tr>
		</table>
		<center>
		<input type="submit" name="Submit" value="提交">
        <input type="reset" name="Submit2" value="重置"><br>
       <h3><span style="font-weight:bold;color:blue;font-family:'楷体'">返回切换界面，请按</span><a href="Login.jsp">这里</a></h3>
      </center>
       </form>
	</div>
	<style scoped="scoped">
		.textbox{
			height:20px;
			margin:0;
		padding:0 2px;
		box-sizing:content-box;
	}
</style>
</body>
</html>
